package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TlDyGoodsVoMapper;
import com.ruoyi.system.domain.TlDyGoodsVo;
import com.ruoyi.system.service.ITlDyGoodsVoService;

/**
 * 采集记录Service业务层处理
 *
 * @author ruoyi
 * @date 2023-11-03
 */
@Service
public class TlDyGoodsVoServiceImpl implements ITlDyGoodsVoService
{
    @Autowired
    private TlDyGoodsVoMapper tlDyGoodsVoMapper;

    /**
     * 查询采集记录
     *
     * @param id 采集记录主键
     * @return 采集记录
     */
    @Override
    public TlDyGoodsVo selectTlDyGoodsVoById(Long id)
    {
        return tlDyGoodsVoMapper.selectTlDyGoodsVoById(id);
    }

    /**
     * 查询采集记录列表
     *
     * @param tlDyGoodsVo 采集记录
     * @return 采集记录
     */
    @Override
    public List<TlDyGoodsVo> selectTlDyGoodsVoList(TlDyGoodsVo tlDyGoodsVo)
    {
        return tlDyGoodsVoMapper.selectTlDyGoodsVoList(tlDyGoodsVo);
    }

    /**
     * 新增采集记录
     *
     * @param tlDyGoodsVo 采集记录
     * @return 结果
     */
    @Override
    public int insertTlDyGoodsVo(TlDyGoodsVo tlDyGoodsVo)
    {
        tlDyGoodsVo.setCreateTime(DateUtils.getNowDate());
        return tlDyGoodsVoMapper.insertTlDyGoodsVo(tlDyGoodsVo);
    }

    /**
     * 修改采集记录
     *
     * @param tlDyGoodsVo 采集记录
     * @return 结果
     */
    @Override
    public int updateTlDyGoodsVo(TlDyGoodsVo tlDyGoodsVo)
    {
        return tlDyGoodsVoMapper.updateTlDyGoodsVo(tlDyGoodsVo);
    }

    /**
     * 批量删除采集记录
     *
     * @param ids 需要删除的采集记录主键
     * @return 结果
     */
    @Override
    public int deleteTlDyGoodsVoByIds(Long[] ids)
    {
        return tlDyGoodsVoMapper.deleteTlDyGoodsVoByIds(ids);
    }

    /**
     * 删除采集记录信息
     *
     * @param id 采集记录主键
     * @return 结果
     */
    @Override
    public int deleteTlDyGoodsVoById(Long id)
    {
        return tlDyGoodsVoMapper.deleteTlDyGoodsVoById(id);
    }

    @Override
    public TlDyGoodsVo selectByUserIdAndState(Long userId, Long state) {
        return tlDyGoodsVoMapper.selectByUserIdAndState(userId,state);
    }
}
